{% extends '@Admin/adminFramework/example/login.html.twig' %}

{% block jquery %}
    <script>
        $('#login-btn').click(function () {
            var username = $('#input-username').val();
            var password = $('#input-password').val();
            var is_check_remember_pwd = $("#checkbox_remember_pwd").prop("checked");

            if(is_check_remember_pwd){
                var remember_pwd = 1;
            }else {
                var remember_pwd = 0;
            }
            var data = {
                "account" : username,
                "password" : password,
                "remember_pwd" : remember_pwd
            };

            $.post("{{ path('admin_auth_login') }}", data,function (result) {
                resultPreprocess(result);
            });
        });

        //响应回车键
        $(document).keyup(function(event){
            if(event.keyCode ==13){
                $("#login-btn").trigger("click");
            }
        });
    </script>
{% endblock %}